package com.xxx.pojo;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.xxx.enums.CommonStatus;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Dish {

    @TableField(value = "dish_name")
    private String name;
    private String typesName;

    @JsonSerialize(using = ToStringSerializer.class)
    private BigDecimal price;

    @TableId(type = IdType.ASSIGN_ID,value = "dish_id")

    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;//商品码
    @TableField("dish_img")
    private String img;//图片地址
    @TableField("`describe`")
    private String describe; //描述信息

    private CommonStatus status;

    @TableField("`order`")
    private Long order;

    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH-mm-ss")
    private LocalDateTime createTime;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH-mm-ss")
    private LocalDateTime updateTime;
    @TableField(fill = FieldFill.INSERT)
    private Long createUser;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Long updateUser;

    @TableLogic
    private Integer deleted;

}
